#include "server.h"


namespace evm { namespace messaging {

ExecutorPtr get_executor(ConfigOptsPtr conf, ListenerPtr listener, DispatcherPtr dispatcher) {
    string rpc_executor = (*conf)["rpc_executor"];
    if (rpc_executor == "threadpool") {
        size_t pool_size = (*conf)["rpc_pool_size"];
        auto executor = ExecutorPtr(new PooledExecutor(listener, dispatcher, pool_size));
        return executor;
    }
    /* Other rpc executors ... */

    throw invalid_argument("Rpc executor '" + rpc_executor + "' not found.");
}

}}
